-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploying by a contract name [1/2] — refactor feature dependencies #565
Deploying by a contract name [1/2] — refactor feature dependencies #565
Conversation
Codecov Report
@@ Coverage Diff @@
## master #565 +/- ##
=======================================
Coverage 82.44% 82.45%
=======================================
Files 175 177 +2
Lines 5943 6029 +86
=======================================
+ Hits 4900 4971 +71
- Misses 1043 1058 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…into feature/support-contract-names-in-cheatcodes
from starkware.starknet.services.api.contract_class import ContractClass | ||
|
||
|
||
class CompiledContractWriter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be a plain function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, it could. Something feels off when mixing paradigms.
It's easier to find a file that contains a class rather than a list of functions. Naming files in the same way as the main exported function is confusing because a function and a filename use the same casing, and that makes importing/patching confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still define single public module function, and name the module the same way. That's what I have seen in the wild.
Something feels off when mixing paradigms.
To me, using classes too much in Python/JS is mixing paradigms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still define single public module function, and name the module the same way. That's what I have seen in the wild.
I did it when I used the functional paradigm. Auto import functionality confused the function with the module, if they were named in the same way. Also, I couldn't patch the function, if it was imported from the __init__.py
(barrel file) from the same reason.
To me, using classes too much in Python/JS is mixing paradigms.
Functional programming is more common in Python, but it doesn't mean that this is the proper tool for the job.
- Object-Oriented Programming is the tool best suited for defining how we cross architectural boundaries with polymorphism and plugins
- Functional programming is the tool we use to push data to the boundaries of our applications
- and Structured programming is the tool we use to write algorithms
https://khalilstemmler.com/articles/software-design-architecture/full-stack-software-design/
ProjectCompiler
project_compiler.py
out ofcommands/build
ProjectCairoPathBuilder
ContractWriter
ProjectCompiler
methods to be smaller and more specific